/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.nct.handler;

import java.util.Observable;
import java.util.Observer;

/**
 *
 * @author annn
 */
public class MemCachedHandler implements Observer {

    public MemCachedHandler(String key, Object value, boolean async) {
        this.key = key;
        this.value = value;
        this.async = async;
    }

    String key;
    Object value;
    boolean async = false;
    boolean isDone;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public boolean isIsDone() {
        return isDone;
    }

    public void setIsDone(boolean isDone) {
        this.isDone = isDone;
    }

    public boolean isAsync() {
        return async;
    }

    public void setAsync(boolean async) {
        this.async = async;
    }

    @Override
    public void update(Observable o, Object arg) {
        if (arg.getClass() == boolean.class) {
            this.isDone = (boolean) arg;
        } else {
            this.value = arg;
        }
    }

}
